<template>
  <div style="padding: 15px 20px 15px 5px">
    <div class="pre-text">{{ text }}</div>
    <vol-form ref="form" :labelWidth="80" :load-key="false" :formFields="fields" :formRules="formOptions">
    </vol-form>



    <div class="form-btns">
      <el-button type="primary" @click="submit" icon="el-icon-check" size="mini">提交</el-button>
      <el-button type="primary" @click="reset" plain icon="el-icon-refresh-right" size="mini">重置</el-button>
    </div>
  </div>
</template>

<script>
// 使用方式：
// 1、新建一个vue页面，把此页面内容复制进去
// 2、router->index.js配置路由，页面上输入地址即可看到数据(也可以把菜单配置上)
// 3、或者参照表单设计页面做动态页面
//**表单设计器的table下载还在开发中

import VolForm from '@/components/basic/VolForm'
export default {
  components: { "vol-form": VolForm, },
  data() {
    return {
      text: "",
      tabsModel: "0",
      fields: { "WarehouseinId": null, "OrderId": null, "SupplierNumber": null, "SupplierName": null, "SupplierPeople": null, "SupplierPhone": null, "MakeupPeople": null, "MakeupTime": null, "Remark": null },
      formOptions: [[{ "field": "WarehouseinId", "title": "入库单号", "type": "text", "required": false, "readonly": false, "colSize": null },
      { "field": "WarehouseinId", "title": "入库类型", "type": "select", "required": true, "readonly": false, "colSize": null, "data": [{ "key": "1", "value": "采购收货入库" }, { "key": "2", "value": "销售退货入库" }, { "key": "3", "value": "生产产品入库" }, { "key": "4", "value": "领用退还入库" }, { "key": "5", "value": "借货入库" }, { "key": "6", "value": "借出入库" }], "dataKey": "入库类型" },
      { "field": "OrderId", "title": "关联订单号", "type": "text", "required": false, "readonly": false, "colSize": null },
      { "field": "SupplierNumber", "title": "供应商编号", "type": "text", "required": true, "readonly": false, "colSize": null },
      { "field": "SupplierName", "title": "供应商名称", "type": "text", "required": true, "readonly": false, "colSize": null }],
      [{ "field": "SupplierPeople", "title": "供应商联系人", "type": "text", "required": false, "readonly": false, "colSize": null },
      { "field": "SupplierPhone", "title": "供应商联系方式", "type": "text", "required": true, "readonly": false, "colSize": null },
      { "field": "MakeupPeople", "title": "制单人", "type": "text", "required": false, "readonly": false, "colSize": null },
      { "field": "MakeupTime", "title": "制单时间", "type": "date", "required": false, "readonly": false, "colSize": null },
      { "field": "Remark", "title": "备注", "type": "textarea", "required": false, "readonly": false, "colSize": null }]],
      tables: [],
      tabs: []
    };
  },
  created() {

  },
  methods: {
    submit() {
      this.$Message.success("submit")
      return;
      this.http.post("url", this.fields, true).then(result => {

      })
    },
    reset() {
      this.$refs.form.reset();
      this.$Message.success("表单已重置")
    },
    download() {
      this.$Message.info("111")
    }
  }
};

VolForm;
</script>
<style lang="less" scoped>
.form-btns {
  text-align: center;
}

.tables {
  padding-left: 15px;

  .table-item {
    padding: 10px;
  }

  .table-header {
    display: flex;
    margin-bottom: 8px;
  }

  .header-text {
    position: relative;
    bottom: -9px;
    flex: 1;
    font-weight: bold;
  }

  .header-btns {
    text-align: right;
  }
}
</style>